package com.spring.demo3.eg3;

import org.springframework.core.annotation.AliasFor;
import org.springframework.stereotype.Component;

import java.lang.annotation.*;

/**
 * @author vhans
 */
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Component
public @interface MyBean {

    // 这样就可以通过自定义的注解为容器设置名称了
    @AliasFor(annotation = Component.class)
    String value() default "";

}
